Announcement

Collapse
No announcement yet.

I can't disable export of grid reports.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I can't disable export of grid reports.

    At /#Admin/settings there are such option "Disable Export (only admin is allowed)" As I understood, it disable EXPORT function in all CRM as general setting. I gave no idea is it a bug or the feature by design, but in some reports user can't export report, but in another one thay van. Who can explain how this feature are working and what should I do to disable export of data in all reports.

    First idea - I can't disable export of grid reports.

  • #2
    export disable for listView.

    Comment


    • #3
      Hi partomas,

      I have tested a scenario identical to yours, everything works as expected. When "Disable Export (only admin is allowed)" = true, then the records export feature is not available for the "Regular" type users.
      Try to disable "Export Permission" via ACL Roles:
      https://docs.espocrm.com/user-guide/...access-control

      Comment


      • #4
        Hi there,

        I have also tested export with Grid Reports, but everything works not as expected... My configuration is: Report = Grid, User type = regular, Disable Export (only admin is allowed) = true, Roles -> Export Permission = no.

        It looks like all export permissions are unavailable, however, a user still can export Grid Reports. Please find a screenshot of my configuration attached.

        Any ideas of how to disable the export of the Grid Report?
        Attached Files

        Comment


        • Vadym
          Vadym commented
          Editing a comment
          Hi partomas,

          Since your user is a member of the teams, try to check the summed user permissions (Administration -> Users -> Access).

      • #5
        application/Espo/Modules/Advanced/Services/Report.php
        search word "export"..

        put this

        $roles = $this->getUser()->getRoles();

        $GLOBALS['log']->warning(json_encode($roles));

        try a export with the user.

        send here on forum the result from data/logs

        As i see, out-of-box, acl check :

        if (!$this->getAcl()->check($report, 'read')) {
        throw new Forbidden();
        }

        Comment


        • #6
          Hmm... I was looking for a solution in the UI, but let's try it your way I am not sure if I put it in the right place since Data logs are not very explicit. I have made the export twice (please find attachments)
          Attached Files

          Comment


          • #7
            Yes it's right place..


            but this work, same place : so only admin can export.. 2 solutions under.. it's not upgrade safe.


            $userRoleList = $this->entityManager
            ->getRepository('User')
            ->getRelation($this->user, 'roles')
            ->find();

            foreach($userRoleList as $role)
            {
            $GLOBALS['log']->warning( $role->get('exportPermission') );
            if ($role->get('exportPermission') == 'not-set') // or 'no'
            {
            throw new Forbidden();
            }
            }
            if ($this->getUser()->isRegular())
            {
            throw new Forbidden();
            }

            for upgrade safe, you can extend to custom folder. only the export function (certainly work i think)

            Comment


            • #8
              Thank you .. maybe it's a feature request or bug..

              Comment


              • #9
                yuri Maybe you will give us the answer:

                If a user is not granted permission to export reports, why a user can still export the Grid report?

                Meanwhile, if a user tries to export the List report he gets an "Error 403: Access Denied..." message. We could not find how to solve this issue in the GUI. I am not a true developer, thus it is not such as easy task for me to make decent changes inside the code...

                Is it a bug or I am doing something wrong?
                Attached Files

                Comment


                • #10
                  I had similar situation and Yuri said that it will be applied to list report on next advanced pack version. Not sure if it will be applied to Grid report as well.
                  Rabii
                  Web Dev

                  Comment

                  Working...
                  X